let data = { name: "一缕清风", age: 25 };

proxyTarget = new Proxy(data, {
  get(target, key) {
    return key === "age" ? `【${target[key]}岁】` : target[key];//如果是获取 年龄 属性，则添加 岁字
  },
  set(target, key, value) {
    if (key === "age" && typeof value !== "number") { throw Error("age字段必须为Number类型"); }
    console.log(`设置${target.constructor.name}的${key}为${value}`);

    return Reflect.set(target, key, value);
  }
});

proxyTarget.age = 19
console.log(`我叫${proxyTarget.name}  我今年${proxyTarget.age}了`);

proxyTarget.name = "Ken"
console.log(`我叫${proxyTarget.name}  我今年${proxyTarget.age}了`);